var status = -1;
var selectionLog = [];

function action(d, c, b) {
    if (status == 0 && d == 0) {
        cm.dispose();
        return
    }
    status++;
    selectionLog[status] = b;
    var a = -1;
    if (status <= a++) {
        cm.dispose()
    } else {
        if (status === a++) {
            cm.npc_ChangeController(1540446, "oid=36146", -178, -784, 25, -225, -144, 1, false, 0, false);
            cm.setPartner(1, 1540765, 80001594, 0);
            cm.setPartner(1, 1540766, 80001595, 0);
            cm.setPartner(1, 1540767, 80001596, 0);
            cm.useItem(2023447);
            cm.useItem(2023448);
            cm.useItem(2023449);
            cm.spawnMobLimit(8240060, 1, 475, -784, 12);
            cm.spawnMobLimit(8240060, 1, 1013, -784, 12);
            cm.spawnMobLimit(8240060, 1, 910, -1594, 12);
            cm.spawnMobLimit(8240060, 1, 278, -1594, 12);
            cm.spawnMobLimit(8240060, 1, 375, -784, 12);
            cm.spawnMobLimit(8240060, 1, -6, -2348, 12);
            cm.spawnMobLimit(8240060, 1, 114, -2348, 12);
            cm.npc_LeaveField("oid=36146");
            cm.npc_LeaveField("oid=36146");
            cm.spawnMobLimit(8240060, 1, 695, -3900, 12);
            cm.spawnMobLimit(8240060, 1, 465, -3900, 12);
            cm.spawnMobLimit(8240060, 1, 479, -3900, 12);
            cm.spawnMobLimit(8240060, 1, 695, -3900, 12);
            cm.spawnMobLimit(8240060, 1, 465, -3900, 12);
            cm.dispose()
        }
    }
}

function start() {
    status = -1;
    action(1, 0, 0)
};